

CONFIG_PLATFORM_FSL_IMX6_LINUX = n
CONFIG_PLATFORM_FSL_IMX6_ANDROID = y

ifeq ($(CONFIG_PLATFORM_FSL_IMX6_LINUX), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -Wno-date-time
# ARCH := arm
# CROSS_COMPILE := arm-poky-linux-gnueabi-
KSRC ?= /home/lenver/work/ZY-DEV/build/obj_kernel
endif

ifeq ($(CONFIG_PLATFORM_FSL_IMX6_ANDROID), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -mno-android
EXTRA_CFLAGS += -Wno-date-time
ARCH := arm
CROSS_COMPILE := arm-linux-androideabi-
KSRC ?= /home/lenver/work/AND7/android-7.1.1_r13-imx/kernel_imx
endif

EXTRA_CFLAGS += -O2
EXTRA_CFLAGS += -Idrivers/net/wireless/rtlwifi

obj-m := 8192cu.o
8192cu-objs	:=	\
		base.o	\
		cam.o	\
		core.o	\
		debug.o	\
		efuse.o	\
		ps.o	\
		rc.o	\
		regd.o	\
		stats.o \
		usb.o	\
		rtl8192c/main.o			\
		rtl8192c/dm_common.o	\
		rtl8192c/fw_common.o	\
		rtl8192c/phy_common.o	\
		rtl8192cu/dm.o		\
		rtl8192cu/hw.o		\
		rtl8192cu/led.o		\
		rtl8192cu/mac.o		\
		rtl8192cu/phy.o		\
		rtl8192cu/rf.o		\
		rtl8192cu/sw.o		\
		rtl8192cu/table.o	\
		rtl8192cu/trx.o


# obj-m	+= btcoexist/
# obj-m	+= rtl8188ee/
# obj-m	+= rtl8192c/
# obj-m	+= rtl8192ce/
# obj-m	+= rtl8192cu/
# obj-m	+= rtl8192de/
# obj-m	+= rtl8192ee/
# obj-m	+= rtl8192se/
# obj-m	+= rtl8723ae/
# obj-m	+= rtl8723com/
# obj-m	+= rtl8723be/
# obj-m	+= rtl8821ae/

ccflags-y += -D__CHECK_ENDIAN__

all: 
	@echo $(KSRC)
	@echo $(ARCH)
	@echo $(CROSS_COMPILE)
	$(MAKE) -C $(KSRC) M=$(PWD) modules ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

clean:
	@rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~ .*.o.d
	@rm -fr rtl8*/*.mod.c rtl8*/*.mod rtl8*/*.o rtl8*/.*.cmd rtl8*/*.ko rtl8*/*~ rtl8*/*.cmd rtl8*/.*.o.d
	@rm -fr bt*/*.mod.c bt*/*.mod bt*/*.o bt*/.*.cmd bt*/*.ko bt*/*~ bt*/*.cmd bt*/.*.o.d
	@rm -fr .tmp_versions
	@rm -fr Modules.symvers
	@rm -fr Module.symvers
	@rm -fr Module.markers
	@rm -fr modules.order rtl8*/modules.order bt*/modules.order
